package com.etheart.framework.core.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;


public interface QueryService {

	public <T> long getRowCount(Class<T> clazz);

	public long getRowCount(DetachedCriteria criteria);

	public <T> List<T> findAll(Class<T> clazz);

	public <T> List<T> findAll(Class<T> clazz,String property,String order);

	public <T> Page<T> findAllPage(Class<T> clazz, int size);

	public <T> long getRowCntByExample(T t);

	public <T> List<T> findByExample(T t);

	public <T> Page<T> findPageByExample(T e, int size);

	public <T> List<T> findRange(Class<T> entity, final int start, final int size);

	public <T> List<T> findListByDetachedCriteria(DetachedCriteria criteria);

	public <T> List<T> findListByDetachedCriteria(DetachedCriteria criteria,final int first,final int count);

	public <T> Page<T> findPageByDetachedCriteria(DetachedCriteria criteria,final int size);

	public <T> T findById(Class<T> clazz,Long id);

}
